<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="fragments/head :: head"></head>
<body >
<div th:replace="fragments/top-nav :: header-nav"></div>
<div class="main-container" id="main-container">
	<div class="main-container-inner">
		<div class="main-content mayi-rsm-main-content">
		<div class="page-content">
		<div class="row">
		<div class="col-xs-12">

				<form id="queryForm" class="form-horizontal">
					<table id="sample-table-2" class="table table-striped table-bordered table-hover">
						<tr>
							<td><input class="input-sm" name="id" placeholder="用户ID" type="text"/></td>
							<td><input class="input-sm" name="name" placeholder="名称" type="text"/></td>
							<td>
								<button type="button" onclick="doQuery()" class="btn btn-purple btn-sm">查询<i class="icon-search icon-on-right bigger-110"></i></button>
								<a th:href="@{/admin/user/add}" class="btn btn-sm btn-success">新增<i class="icon-arrow-right icon-on-right bigger-110"></i></a>
							</td>
						</tr>
					</table>
				</form>
				<div class="table-responsive" id="dataList">

				</div>

		</div>
		</div>
		</div>
		</div>
	</div>
</div>
<div th:replace="fragments/footer :: footer"></div>
<script th:inline="javascript">
	$(function(){
       doQuery();
	});

	function doQuery(){
	    var userListData = /*[[@{/admin/user/list}]]*/;
		common.ajaxQuery(userListData);
	}

	function deleteById( id ){
	   var uri = /*[[@{/admin/user/delete}]]*/;
	   common.ajaxDelete(uri+ "/"+id,null,"doQuery()");
	}

	function resetPwd( id ){
	   var uri = /*[[@{/admin/user/pwd/reset}]]*/;
	   common.ajaxAction(uri+ "/"+id,"重置密码",null,"successFun()");
	}

	function successFun(){
		alert("重置密码成功!");
	}
</script>
</body>
</html>
